#include "dummydata.h"

dummyData::dummyData()
{
    createItems();
    createTree();

    browse = CHROME;
    appData = QString(getenv("LOCALAPPDATA"));
    qDebug()<<appData;
    chromePath = appData + QString(CHROMEPATH);
    firefoxPath = QString("C:\\Program Files\\Mozilla Firefox\\firefox.exe");
    qDebug()<<chromePath;
    IEPath = QString("C:\\Program Files\\Internet Explorer\\iexplore.exe");

    bpath[0] = chromePath;
    bpath[1] = firefoxPath;
    bpath[2] = IEPath;
    bpath[3] = chromePath;
}

void dummyData::createItems()
{
    //Singular
    QStringList fbTagList;
    fbTagList << "Social" << "Fav" <<"Life" <<"Evil";
    item facebook = { QString("Facebook") , fbTagList, QString("http://www.facebook.com"),QString(":/images/facebook.jpg"), BOOKMARK };
    data.append(facebook);
    item pinterest = { QString("Pinterest"), QStringList("Social")<<"Art", QString("http://www.pinterest.com"),QString(":/images/pinterest.jpg"), BOOKMARK};
    data.append(pinterest);
    item ivle = { QString("IVLE"), QStringList("School"), QString("http://ivle.nus.edu.sg"),QString(":/images/ivle.jpg"), BOOKMARK };
    data.append(ivle);
    item gmail = { QString("GMail"), QStringList("Fav"), QString("http://mail.google.com"),QString(":/images/gmail.jpg"), BOOKMARK };
    data.append(gmail);
    item coffitivity = { QString("Coffitivity"), QStringList(), QString("http://coffitivity.com") ,QString(":/images/coffitivity.jpg"), BOOKMARK };
    data.append(coffitivity);

    //Music folder
    item youtube = { QString("YouTube"), QStringList("Music")<<"Fav", QString("http://www.youtube.com"),QString(":/images/youtube.jpg"), BOOKMARK};
    data.append(youtube);
    item grooveshark = { QString("Grooveshark"), QStringList("Music")<<"Fav", QString("http://www.grooveshark.com"), QString(":/images/grooveshark.jpg"), BOOKMARK  };
    data.append(grooveshark);
    item soundcloud = { QString("SoundCloud"), QStringList("Music"), QString("https://soundcloud.com"),QString(":/images/soundcloud.jpg"), BOOKMARK };
    data.append(soundcloud);

    //Type folder
    item losttype = { QString("Lost Type Co-op"), QStringList("Design"), QString("http://losttype.com"),QString(":/images/losttype.jpg"), BOOKMARK };
    data.append(losttype);
    item fontsq = { QString("Font Squirrel"), QStringList("Design"), QString("http://www.fontsquirrel.com"),QString(":/images/fontsq.jpg"), BOOKMARK };
    data.append(fontsq);
    item lmt = { QString("The League of Moveable Type"), QStringList("Design"), QString("http://www.theleagueofmoveabletype.com"),QString(":/images/lmt.jpg"), BOOKMARK };
    data.append(lmt);
    item halfc = { QString("half-circle"), QStringList("Design"), QString("http://half-circle.com"),QString(":/images/halfcir.jpg"), BOOKMARK };
    data.append(halfc);
    item bestFonts = { QString("awwwards best fonts 2012"), QStringList("Design"), QString("http://www.awwwards.com/100-greatest-free-fonts-collection.html"),QString(":/images/bestfonts.jpg"), BOOKMARK };
    data.append(bestFonts);

    //Modules folder(s)
    item stats = { QString("Ajay Jasra"), QStringList("School"), QString("http://www.stat.nus.edu.sg/~staja/"),QString(":/images/stats.jpg"), BOOKMARK };
    data.append(stats);
    item networks = { QString("CS2105 blog"), QStringList("School"), QString("http://blog.nus.edu.sg/cs2105/"),QString(":/images/cs2105.jpg"), BOOKMARK };
    data.append(networks);
    item uidev = { QString("CS3249 blog"), QStringList("School"), QString("http://www.comp.nus.edu.sg/~cs3249/"),QString(":/images/cs3249.jpg"), BOOKMARK };
    data.append(uidev);
    item qtasst = { QString("Qt Assistant Manual"), QStringList("School"), QString("http://qt-project.org/doc/qt-4.8/assistant-manual.html"),QString(":/images/qtasst.jpg"), BOOKMARK };
    data.append(qtasst);
    item cio = { QString("Collaborative Internet Observatory"), QStringList("School"), QString("http://wiki.nus.edu.sg/display/CIO/Collaborative+Internet+Observatory"),QString(":/images/cio.jpg"), BOOKMARK };
    data.append(cio);
    item vis = { QString("Visualisation Tools"), QStringList("School"), QString("http://www.computerworld.com/s/article/9214755/Chart_and_image_gallery_30_free_tools_for_data_visualization_and_analysis"),QString(":/images/vis.jpg"), BOOKMARK };
    data.append(vis);
    item holidays = { QString("Public Holidays Database"), QStringList("School"), QString("http://www.qppstudio.net/publicholidays.htm"),QString(":/images/holidays.jpg"), BOOKMARK };
    data.append(holidays);

    //Art folder(s)
    item behance = { QString("Behance"), QStringList("Art")<<"Design", QString("http://www.behance.net/"),QString(":/images/behance.jpg"), BOOKMARK };
    data.append(behance);
    item designspiration = { QString("Designspiration"), QStringList("Art")<<"Design", QString("http://designspiration.net/"),QString(":/images/designspiration.jpg"), BOOKMARK };
    data.append(designspiration);
    item designtaxi = { QString("DesignTAXI"), QStringList("Design"), QString("http://designtaxi.com/"),QString(":/images/taxi.jpg"), BOOKMARK };
    data.append(designtaxi);
    item dribble = { QString("Dribble"), QStringList("Art")<<"Design", QString("http://dribbble.com/"),QString(":/images/dribble.jpg"), BOOKMARK };
    data.append(dribble);
    item awwwards = { QString("Awwwards"), QStringList("Design")<<"Web", QString("http://www.awwwards.com/"),QString(":/images/awwwards.jpg"), BOOKMARK };
    data.append(awwwards);
    item abduzeedo = { QString("Abduzeedo"), QStringList("Art")<<"Design", QString("http://abduzeedo.com/"),QString(":/images/abduzeedo.jpg"), BOOKMARK };
    data.append(abduzeedo);
    item loish = { QString("Loish"), QStringList("Art"), QString("http://loish.net/"),QString(":/images/loish.jpg"), BOOKMARK };
    data.append(loish);
    item orianart = { QString("ORIANART"), QStringList("Art"), QString("http://www.orianart.com/"),QString(":/images/orianart.jpg"), BOOKMARK };
    data.append(orianart);
    item veerle = { QString("The Inspiration Stream"), QStringList("Art"), QString("http://veerle.duoh.com/inspiration"),QString(":/images/veerle.jpg"), BOOKMARK };
    data.append(veerle);
    item served = { QString("Illustration Served"), QStringList("Art"), QString("http://www.illustrationserved.com/"),QString(":/images/served.jpg"), BOOKMARK };
    data.append(served);

    //Web dev folder
    item boilerplate = { QString("HTML5 Boilerplate"), QStringList("Web"), QString("http://html5boilerplate.com/"),QString(":/images/boilerplate.JPG"), BOOKMARK };
    data.append(boilerplate);
    item expweb = { QString("The Expressive Web"), QStringList("Web"), QString("http://beta.theexpressiveweb.com/"),QString(":/images/expweb.JPG"), BOOKMARK };
    data.append(expweb);
    item jquery = { QString("jQuery API"), QStringList("Web"), QString("http://api.jquery.com/"),QString(":/images/jquery.JPG"), BOOKMARK };
    data.append(jquery);
}

void dummyData::createTree() {
    QTreeWidgetItem* root = ActualDataModel::getRoot();

    for(int i=0; i<5; i++)
    {
        ActualDataModel::add(root, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }

    //Music folder
    QTreeWidgetItem* music = ActualDataModel::add(root, QString("Music"), QStringList(), QString(), QString(), FOLDER);
    for(int i=5; i<8; i++)
    {
        ActualDataModel::add(music, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }

    //Type folder
    QTreeWidgetItem* type = ActualDataModel::add(root, QString("Type"), QStringList(), QString(), QString(), FOLDER);
    for(int i=8; i<13; i++)
    {
        ActualDataModel::add(type, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }

    //Modules folder
    QTreeWidgetItem* modules = ActualDataModel::add(root, QString("Modules"), QStringList(), QString(), QString(), FOLDER);
    QTreeWidgetItem* st2334 = ActualDataModel::add(modules, QString("ST2334"), QStringList(), QString(), QString(), FOLDER);
    for(int i=13; i<14; i++)
    {
        ActualDataModel::add(st2334, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }
    QTreeWidgetItem* cs2105 = ActualDataModel::add(modules, QString("CS2105"), QStringList(), QString(), QString(), FOLDER);
    for(int i=14; i<15; i++)
    {
        ActualDataModel::add(cs2105, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }
    QTreeWidgetItem* cs3249 = ActualDataModel::add(modules, QString("CS3249"), QStringList(), QString(), QString(), FOLDER);
    for(int i=15; i<18; i++)
    {
        ActualDataModel::add(cs3249, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }
    QTreeWidgetItem* nm3229 = ActualDataModel::add(modules, QString("NM3229"), QStringList(), QString(), QString(), FOLDER);
    for(int i=18; i<20; i++)
    {
        ActualDataModel::add(nm3229, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }

    //Art folder
    QTreeWidgetItem* art = ActualDataModel::add(root, QString("Art"), QStringList(), QString(), QString(), FOLDER);
    for(int i=20; i<21; i++)
    {
        ActualDataModel::add(art, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }
    QTreeWidgetItem* design = ActualDataModel::add(art, QString("Design"), QStringList(), QString(), QString(), FOLDER);
    for(int i=21; i<25; i++)
    {
        ActualDataModel::add(design, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }
    QTreeWidgetItem* illustration = ActualDataModel::add(art, QString("Illustration"), QStringList(), QString(), QString(), FOLDER);
    for(int i=25; i<30; i++)
    {
        ActualDataModel::add(illustration, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }

    //Web dev folder
    QTreeWidgetItem* webdev = ActualDataModel::add(root, QString("Web dev"), QStringList(), QString(), QString(), FOLDER);
    for(int i=30; i<33; i++)
    {
        ActualDataModel::add(webdev, data[i].name, data[i].tags, data[i].address, data[i].thumbPath, BOOKMARK);
    }
}
